The present technology relates to an image conversion program and an image conversion apparatus, and more particularly, to an image conversion program and an image conversion apparatus for executing predetermined image conversion processing with respect to an image before conversion and displaying a converted image.
Patent Document 1 (Japanese Laid-Open Patent Publication No. 2004-265168) discloses an image generation apparatus for generating a bilaterally symmetrical (or vertically symmetrical) image. The image generation apparatus assumes, for example, an image of a face of an animal, and the like as an object to be processed, and converts the image into a bilaterally symmetrical image. More specifically, the image generation apparatus defines an eye area (an A area 110 and a B area 120 shown in FIG. 4 of Patent Document 1) and a nose area (a C area 130 shown in the same figure), and calculates a line as an axis for dividing an image into two images from these eye and nose areas. One of the two images divided by the calculated axis is converted into an image obtained by inverting the other image about the axis, thereby generating a bilaterally symmetrical image.
In the image generation apparatus described in the above Patent Document 1, a user cannot directly set a line (axis) for dividing an image into two images, and cannot set a line at a desired position and in a desired direction. Since the user cannot freely set a line, the user cannot obtain various images, and there is a problem that obtained images are uniform.
Therefore, a feature of an example embodiment presented herein is to provide an image conversion program and image conversion apparatus which allows the user to freely set a line for dividing an image, thereby obtaining various images as images after conversion.
The present embodiment has the following features to attain the above. It is noted that reference characters and supplementary explanations in parentheses in this section are merely provided to facilitate the understanding of the present embodiment in relation to the later-described embodiment, rather than limiting the scope of the present embodiment in any way.
A first aspect is a storage medium (a stored data memory 34 or a memory card 28) storing an image conversion program (61) which is executed by a computer (a CPU 31) of an image conversion apparatus (a game apparatus 10) which converts an image and displays a converted image on a display device (a lower LCD 12). The image conversion program causes the computer to execute an original image display step (S33), a dividing line setting step (S4), and a change step (S5). At the original image display step, the computer displays an original image before conversion on the display device. At the dividing line setting step, the computer sets a dividing line (52) for dividing an area of an image displayed on the display device into a first area (53) and a second area (54) by an instruction from a user. At the change step, the computer converts the original image by changing at least a part of an image of the first area to an image generated from an image of the second area, and displays an image after the conversion on the display device (FIG. 5).
In a second aspect, the image conversion apparatus may include a pointing device (a touch panel 13) capable of performing an input for designating a position on a screen of the display device. In this case, the image conversion program further causes the computer to execute an input obtaining step (S11) of obtaining an input position inputted by the pointing device. At the dividing line setting step, the computer sets the dividing line based on the input position obtained at the input obtaining step.
In a third aspect, the input obtaining step may be repeatedly executed every a predetermined time period. In this case, at the dividing line setting step, the computer sets the dividing line based on a plurality of input positions continuously obtained at the input obtaining step which is executed a plurality of times.
In a fourth aspect, the dividing line setting step may include a selection step (S14, S20, S21) of selecting the dividing line among a plurality of candidate dividing lines set on the screen based on the plurality of input positions.
In a fifth aspect, at the selection step, the computer may calculate a position and a direction on the screen from the plurality of input positions, and may select the dividing line among the candidate dividing lines based on the calculated position and direction.
In a sixth aspect, the plurality of candidate dividing lines may be set so as to extend through lattice points which are arranged on the screen in a lattice-like pattern (FIG. 7). In this case, at the selection step, the computer selects, among candidate dividing lines extending through a lattice point closest to a first input position among the plurality of input positions, a candidate dividing line having a tilt closest to a tilt of a straight line which connects the first input position and a second input position after the first input position among the plurality of input positions as the dividing line.
In a seventh aspect, at the selection step, the computer may set an input position (a touch-on position) which is first obtained among the plurality of input positions as the first input position, and may set an input position (a touch-off position) which is last obtained among the plurality of input positions as the second input position.
In an eighth aspect, the dividing line setting step may include a selection step (S21) of selecting the dividing line among a plurality of candidate dividing lines set on a screen of the display device in accordance with an instruction from the user.
In a ninth aspect, the image conversion program may further cause the computer to execute an object locating step (S1) of locating an object composed of a plurality of polygons in a virtual three-dimensional space such that when the object is displayed on the screen, the plurality of candidate dividing lines coincide with sides of the polygons (FIGS. 7 and 8). In this case, the image conversion apparatus stores association data (67) in which a position on the original image is associated with each top of the plurality of polygons. At the original image display step, the computer displays the original image by drawing the object using the original image as a texture in accordance with associations in the association data. At the change step, the computer converts the original image by changing the associations in the association data.
In a tenth aspect, the plurality of candidate dividing lines may be straight lines, and set such that when an image area is divided by any candidate dividing line, a position of each top of the polygons in a smaller area is line symmetrical to any of positions of tops of the polygons in a larger area about the candidate dividing line (FIGS. 7 and 8). In this case, at the change step, the computer changes the associations such that an image after the conversion is line symmetrical about the dividing line.
In an eleventh aspect, the plurality of candidate dividing lines may be straight lines, and set such that when at least one of two areas divided by any candidate dividing line is inverted about the candidate dividing line, the inverted area covers an entirety of the other area. In this case, at the change step, the computer converts the image of the first area such that an image after the conversion is line symmetrical about the dividing line.
In a twelfth aspect, at the dividing line setting step, the computer may set a straight line as the dividing line. In this case, at the change step, the computer changes the image of the first area such that an image after the conversion is line symmetrical about the dividing line.
In a thirteenth aspect, the change step may include a comparison step (S31) and a conversion performing step (S32). At the comparison step, the computer compares sizes of two areas divided by the dividing line. At the conversion performing step, the computer converts the original image with an area which is determined to be larger at the comparison step set as the second area.
In a fourteenth aspect, the image conversion program may further cause the computer to execute a determination step (S41) and a dividing line resetting step (S42). At the determination step, the computer determines whether or not an entirety of the first area is covered by the image of the second area which is inverted about the dividing line at the change step. At the dividing line resetting step, the computer sets a boundary line included in the first area among boundary lines of the inverted image of the second area as a new dividing line when it is determined at the determination step that a part of the first area is not covered by the inverted image of the second area. In this case, at the change step, the computer converts an image based on the set dividing line again when a dividing line is set at the dividing line resetting step.
In a fifteenth aspect, the image conversion program may cause the computer to repeatedly execute the dividing line setting step and the change step.
In a sixteenth aspect, the image conversion program may further cause the computer to execute an image obtaining step (S2) of repeatedly obtaining an image taken by imaging means (a camera 23 or 25) of the image conversion apparatus. In this case, at the original image display step, the computer uses the image taken by the imaging means of the image conversion apparatus as the original image. At the change step, the computer displays an image after the conversion on the display device with the obtained image used as the original image every time an image is obtained at the image obtaining step.
In a seventeenth aspect, the image conversion program may further cause the computer to execute an image storage step (S7) of storing an image displayed on the display device in storage means (the stored data memory 34) when an instruction to store an image is performed by the user.
Further, the present embodiment may be provided in a form of an image conversion apparatus having the same function as that of an image conversion apparatus which executes each of the steps in the first to seventeenth aspects. It is noted that in the image conversion apparatus, a CPU executing the image conversion program may execute each of the above steps, or a dedicated circuit of the image conversion apparatus may execute a part or an entirety of processing at each of the above steps.
According to the first aspect, since the dividing line is set at the dividing line setting step by the instruction from the user, the user can freely set a dividing line. Thus, the user can freely generate a conversion image, and can generate various images as conversion images.
According to the second aspect, the user can set the dividing line with the pointing device. Thus, the user can directly perform an input on the original image, and thus can intuitively perform an operation. Further, according to the third aspect, the user can set the dividing line by performing an input so as to draw a line. Thus, the user can set a dividing line as if the user directly inputted a dividing line with respect to the original image, and hence an operation manner capable of performing an intuitive operation and having an excellent operational feeling can be provided.
According to the fourth aspect, since the dividing line is selected among the candidate dividing lines, even when the user cannot successfully input a dividing line (e.g. even when the user cannot precisely input a straight line), a dividing line can be precisely set.
According to the fifth aspect, since the dividing line is selected based on the position and the direction of the line drawn on the screen by the user, a candidate dividing line according to user's intention can be precisely selected.
According to the sixth aspect, by using two input positions, a dividing line according to user's intention can be selected. Particularly, according to the seventh aspect, by setting a position at which an input is started as the first input position and a position at which the input is finished as the second input position, a position and a direction according to user's intention can be precisely extracted from a line drawn by the user.
According to the eighth aspect, since the dividing line is selected among the candidate dividing lines, the user can easily set a dividing line.
According to the ninth aspect, by locating the polygons composing the object so as to coincide with the candidate dividing lines, an image can be easily changed. In other words, the computer can easily change an image by changing the associations of the tops of the polygons with the positions on the screen.
According to the tenth aspect, when the associations are changed at the change step, the computer can change a position on the original image which is associated with a top to a position on the original image which is associated with another top. Thus, the computer can easily calculate an association after the change.
According to the eleventh aspect, by changing the image of the smaller area among the areas divided by the dividing line to the image obtained by inverting the image of the larger area, continuity of an image after the conversion can be maintained.
According to the twelfth aspect, an image which is line symmetrical about the dividing line can be generated by the image conversion processing.
According to the thirteenth aspect, since the image of the smaller area is overwritten with the image obtained by inverting the image of the larger area, it is more likely to maintain continuity of an image after the conversion.
According to the fourteenth aspect, since image conversion is executed again when continuity of an image after the conversion is lost, an image which maintains its continuity can be finally and reliably obtained.
According to the fifteenth aspect, since the user can set the dividing line with respect to the image after the conversion, the image conversion processing can be repeatedly executed. By repeatedly executing the image conversion processing, more various images can be generated.
According to the sixteenth aspect, the image conversion processing can be executed with respect to an image (a moving image) which is taken by the user and changed in real time, and the image which has been subjected to the image conversion processing can be displayed. Further, according to the seventeenth aspect, the image after the image conversion processing can be stored.
These and other features, aspects and advantages of the present embodiment will become more apparent from the following detailed description of the present embodiment when taken in conjunction with the accompanying drawings.